<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(function(){
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出二维码数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/app/mmsQrcode/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
		})
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/app/mmsQrcode/">二维码列表</a></li>
		<li><a href="${ctx}/app/mmsQrcode/form">二维码添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="mmsQrcode" action="${ctx}/app/mmsQrcode/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>活动名称：</label>
				<form:select path="activityId" class="input-medium">
					<option value="">&nbsp;&nbsp;&nbsp;&nbsp;-----请选择-----&nbsp;&nbsp;&nbsp;&nbsp;</option>
					<form:options items="${activityList}" itemLabel="activityName" itemValue="id" htmlEscape="false"/>
				</form:select>
			<label>二维码类型：</label>
				<form:select path="qrcodeType" class="input-medium">
					<option value="">&nbsp;&nbsp;&nbsp;&nbsp;-----请选择-----&nbsp;&nbsp;&nbsp;&nbsp;</option>
				<form:options items="${fns:getDictList('mmsQrcode')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
			<label>二维码号段：</label>
				<form:input path="beginNum" htmlEscape="false" maxlength="50" class="input-mini"/>~<form:input path="endNum" htmlEscape="false" maxlength="50" class="input-mini"/>
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
			<input id="btnExport" class="btn btn-primary" type="button" value="导出链接"/>
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><!-- <th></th> --><th>编号</th><th>活动名称</th><th>二维码类型</th><th>二维码号段</th><th>二维码链接</th><th>操作</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="mmsQrcode">
			<tr>
			<%-- <td><a href="${ctx}/app/mmsActivity/form?id=${mmsActivity.id}">${mmsActivity.appproject.appName}</a></td> --%>
				<%-- <td><input type="hidden" name="ids" value="${appexercise.id}"/>
					<input type="checkbox"/>
				</td> --%>
				<td>${mmsQrcode.id}</td>
				<td><a href="${ctx}/app/mmsQrcode/form?id=${mmsQrcode.id}">${mmsQrcode.mmsActivity.activityName }
					<%-- <c:forEach items="${activityList}" var="activity">
							<c:choose>
								<c:when test="${activity.id==mmsQrcode.activityId}">
									${activity.activityName}
								</c:when>
							</c:choose>
						</c:forEach> --%>
				</a></td>
				<td>${mmsQrcode.qrcodeType eq '0'?'书':'宣传单页'}</td>
				<td>${mmsQrcode.beginNum}-${mmsQrcode.endNum}</td>
				<td>${mmsQrcode.qrcodeUrl}</td>
				<td>
					<a href="${ctx}/app/mmsQrcode/delete?id=${mmsQrcode.id}" onclick="return confirmx('确认要删除该二维码吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>